﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;

namespace SpreadSheetFramework.Util.Validate
{
    public class ObjValidateDatetime:ObjValidateBase
    {
        public ObjValidateDatetime(string errStr) : base(errStr)
        {
        }

        public override bool IsValidate(object value)
        {
            var enUS = new CultureInfo("en-US"); 
            DateTime cv;
            if (value == null || !DateTime.TryParseExact(value.ToString(), "dd/MM/yyyy", enUS,DateTimeStyles.None, out cv))
                return false;
            return true;
        }
    }
}